#define _CRT_SECURE_NO_WARNINGS 1

//# include<bits/stdc++.h>
//using namespace std;
//
//
//int main()
//{
//    int n = 0;
//    double m = 0.0;
//    cin >> n >> m;
//    for (int i = 0; i < n; ++i)
//    {
//        double tmp = 0.0;
//        cin >> tmp;
//        if (tmp < m)    printf("On Sale! %.1f\n", tmp);
//    }
//    return 0;
//}


# include<bits/stdc++.h>
using namespace std;


int main()
{
    int arr[25] = { 0 };
    for (int i = 0; i < 24; ++i)
    {
        cin >> arr[i];
    }
    int tmp = 0;
    cin >> tmp;
    while (tmp >= 0 && tmp < 24)
    {
        if (arr[tmp] > 50)    cout << arr[tmp] << " Yes" << endl;
        else    cout << arr[tmp] << " No" << endl;
        cin >> tmp;
    }
    cout << "finish!";
    cout << "finish!";
    return 0;
}





